﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Tunnel.Devices.DeviceEntity
{
    public partial class LC : DeviceBase
    {
        public LC()
        {
            InitializeComponent();
            this.Size = new Size(50, 50);
        }

        public override string StatusDescription
        {
            get
            {
                return base.StatusDescription;
            }

            set
            {
                switch(value)
                {
                    case "正常":
                        {
                            this.Image = ResPic.PLC正常1;
                            try
                            {
                                Global.PlcStatus[this.DeviceId] = true;
                            }
                            catch { }
                        }
                        break;
                    case "故障":
                        {
                            this.Image = ResPic.PLC故障1;
                            try
                            {
                                Global.PlcStatus[this.DeviceId] = false;
                            }
                            catch { }
                        }
                        break;
                }

                base.StatusDescription = value;
            }
        }


        public override void SendCommand(CommandType commandType)
        {
            throw new NotImplementedException();
        }

        protected override void OnPaint(PaintEventArgs pe)
        {
            base.OnPaint(pe);
        }
    }
}
